﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.QcManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.QcManagement.QcInspectRecordVMs
{
    public partial class QcInspectRecordTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._QcInspectRecord._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.ProductId);
        [Display(Name = "_Model._QcInspectRecord._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.ProductName);
        [Display(Name = "_Model._QcInspectRecord._QcType")]
        public ExcelPropety QcType_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.QcType);
        [Display(Name = "_Model._QcInspectRecord._InspectName")]
        public ExcelPropety InspectName_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.InspectName);
        [Display(Name = "_Model._QcInspectRecord._InspectTool")]
        public ExcelPropety InspectTool_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.InspectTool);
        [Display(Name = "_Model._QcInspectRecord._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.Remark);
        [Display(Name = "_Model._QcInspectRecord._QcResult")]
        public ExcelPropety QcResult_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.QcResult);
        [Display(Name = "_Model._QcInspectRecord._Content")]
        public ExcelPropety Content_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.Content);
        [Display(Name = "_Model._QcInspectRecord._RefValue")]
        public ExcelPropety RefValue_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.RefValue);
        [Display(Name = "_Model._QcInspectRecord._QcValue")]
        public ExcelPropety QcValue_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.QcValue);
        [Display(Name = "_Model._QcInspectRecord._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.OpCode);
        [Display(Name = "_Model._QcInspectRecord._Sn")]
        public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.Sn);
        [Display(Name = "_Model._QcInspectRecord._Sheet")]
        public ExcelPropety Sheet_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.SheetId);
        [Display(Name = "_Model._QcInspectRecord._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.CreateTime, true);
        [Display(Name = "_Model._QcInspectRecord._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.UpdateTime, true);
        [Display(Name = "_Model._QcInspectRecord._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.CreateBy);
        [Display(Name = "_Model._QcInspectRecord._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.UpdateBy);
        [Display(Name = "_Model._QcInspectRecord._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.IsValid);
        [Display(Name = "_Model._QcInspectRecord._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<QcInspectRecord>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Sheet_Excel.DataType = ColumnDataType.ComboBox;
            Sheet_Excel.ListItems = DC.Set<QcSheet>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class QcInspectRecordImportVM : BaseImportVM<QcInspectRecordTemplateVM, QcInspectRecord>
    {
            //import

    }

}